
import service from "@/api/index.js";
//将所有的针对admin的请求都封装到一个对象中
const courseApi = {
    /*获取所有=课程信息*/
    getAllCourse(params){
        return service.get('/course',{params}).then(response=>response.data)
    },
    getAllCourses(){
        return service.get('/course/getAllCourse',{}).then(response=>response.data)
    },
    getAllCourseVo(){
        return service.get('/course/getAll').then(response=>response.data)
    },
    /*校验名称*/
    checkName(name){
        return service.get('/course/checkName',{params:{name:name}}).then(response=>response.data)
    },
    /*校验手机号*/
    checkPhone(phone){
        return service.get('/course/checkPhone',{params:{phone:phone}}).then(resp=>resp.data)
    },
    /*添加=课程*/
    addCourse(course){
        return service.post('/course',course).then(resp=>resp.data)
    },
    /*编辑*/
    editCourse(course){
        return service.put('/course',course).then(resp=>resp.data)
    },
    /*删除课程*/
    remove(id){
        return service.delete('/course/'+id).then(resp=>resp.data)
    },
    /*批量删除*/
    delSelected(ids){
        return service.post('/course/delSelected',ids).then(resp=>resp.data)
    }
}
export default courseApi;